
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
           while (in.hasNext()){
            int n = in.nextInt();
            int[] a = new int[3 * n];
            for (int i = 0; i < 3 * n; i++) {
                a[i] = in.nextInt();
            }
            Arrays.sort(a);
            long sum = 0;
            for (int i = n; i < a.length; i+=2) {
                    sum += a[i];
            }
            System.out.println(sum);
        }
    }
}
